module.exports = {
    title: 'Dyend App - 全面兼容 nvue 的 uni-app 生态框架 - uni-app UI 框架', // 设置网站标题
    description: 'Dyend App UI，是基于uni-app生态的UI框架',
    base: '/',
    dest: 'dist',
    markdown: {
        //lineNumbers: true
        extendMarkdown: (md) => {
            md.use(require('markdown-it-copy'), {
                btnText: 'copy',
                failText: '❌ Copy failed',
                successText: '✅ Copy success!',
                successTextDelay: 2000,
            })
        },
    },
    plugins: {
        'demo-container': {
            component: 'CustomDemoBlock',
        },
    },
    locales: {
        // 键名是该语言所属的子路径
        // 作为特例，默认语言可以使用 '/' 作为其路径。
        '/': {
            lang: 'zh-CN', // 将会被设置为 <html> 的 lang 属性
        },
    },
    evergreen: true, // 只适配现代浏览器
    configureWebpack: (config, isServer) => {
        const defaultConfig = {
            node: {
                global: true,
            },
        }

        // 只有在发布 (isServer=true) 的时候才进行此修改操作，否则在本地预览时出问题
        if (isServer) {
            const newConfig = {
                output: {
                    filename: `assets/js/[name].${+new Date()}.[chunkhash].js`,
                },
            }
            // 修改客户端的 webpack 配置
            // 加入一个时间戳，让每次编译时，文件都不一样，也即每次发版本，都强行更新所有文件
            return Object.assign(defaultConfig, newConfig)
        } else {
            return defaultConfig
        }
    },
    head: [
        [
            'meta',
            {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
            },
        ],
        [
            'meta',
            {
                name: 'keywords',
                content:
                    'Dyend App,dyendappui,uview ui,dyendappui,Dyend Appui,Dyend AppUI,Dyend App UI,uni ui,uni UI,uni-app ui框架,uni-app UI框架,uniapp ui,ui,UI框架,uniapp ui框架,uniapp UI',
            },
        ],
    ],

    themeConfig: {
        baseUrl: 'https://dyendappui.api.com',
        search: true, // 是否显示顶部搜索框
        searchPlaceholder: '搜索文档关键字',
        sidebarDepth: 0,
        // lastUpdated: '上次更新时间',
        nav: [
            {
                text: '指南',
                link: '/guide/intro',
            },
            {
                text: '组件',
                link: '/components/color',
            },
            {
                text: '工具库',
                link: '/tools/intro',
            },
        ],
        sidebar: {
            '/components/': [
                {
                    title: '组件',
                    collapsable: false,
                    sidebarDepth: 0,
                    children: [
                        {
                            title: '基础组件',
                            collapsable: false,
                            sidebarDepth: 0,
                            children: [
                                ['/components/badge', 'badge 徽标'],
                                ['/components/button', 'button 按钮'],
                                ['/components/circleProgress', 'circle-progress 圆形进度条'],
                                ['/components/countDown', 'count-down 倒计时'],
                                ['/components/countUp', 'count-up 数字滚动'],
                                ['/components/divider', 'divider 分割线'],
                                ['/components/icon', 'icon 图标'],
                                ['/components/img', 'img 图片'],
                                ['/components/imgCropper', 'img-cropper 图片裁剪'],
                                ['/components/loading', 'Loading 加载中'],
                                ['/components/lineProgress', 'line-progress 线形进度条'],
                                ['/components/marquee', 'marquee 跑马灯'],
                                ['/components/notify', 'notify 消息通知'],
                                ['/components/swiper', 'swiper 轮播图'],
                                ['/components/waterfall', 'waterfall 瀑布流'],
                            ],
                        },
                        {
                            title: '布局组件',
                            collapsable: false,
                            sidebarDepth: 0,
                            children: [
                                ['/components/bottomBar', 'bottom-bar 底部按钮栏'],
                                ['/components/card', 'card 卡片'],
                                ['/components/divider', 'divider 分割线'],
                                ['/components/list', 'list 列表'],
                                ['/components/gap', 'gap 间隔槽'],
                                ['/components/grid', 'grid 宫格'],
                                ['/components/navbar', 'navbar 导航栏'],
                                ['/components/section', 'section 区块'],
                                ['/components/skeleton', 'skeleton 骨架屏'],
                                ['/components/statusBar', 'status-bar 状态栏'],
                                ['/components/tabs', 'tabs 标签栏'],
                            ],
                        },
                        {
                            title: '选择器组件',
                            collapsable: false,
                            sidebarDepth: 0,
                            children: [
                                ['/components/actionSheet', 'action-sheet 动作面板'],
                                ['/components/calendar', 'calendar 日历'],
                                ['/components/calendarPanel', 'calendar-panel 日历面板'],
                                ['/components/datePicker', 'date-picker 日期选择器'],
                                ['/components/dropdown', 'dropdown 下拉选择器'],
                                ['/components/picker', 'picker 选择器'],
                                ['/components/popupSelect', 'popup-select 弹出选择'],
                                ['/components/regionsSelect', 'regions-select 地区选择'],
                                ['/components/select', 'select 列表选择器'],
                            ],
                        },
                        {
                            title: '反馈组件',
                            collapsable: false,
                            sidebarDepth: 0,
                            children: [
                                ['/components/notify', 'notify 消息通知'],
                                ['/components/modal', 'modal 模态窗'],
                                ['/components/mask', 'mask 遮罩层'],
                                ['/components/popup', 'popup 弹出层'],
                            ],
                        },
                        {
                            title: '表单组件',
                            collapsable: false,
                            sidebarDepth: 0,
                            children: [
                                ['/components/codeInput', 'code-input 校验码输入'],
                                ['/components/checkbox', 'check-box 复选框'],
                                ['/components/form', 'form 表单'],
                                ['/components/input', 'input 输入框'],
                                ['/components/numberKeyboard', 'number-Keyboard 数字键盘'],
                                ['/components/pagination', 'pagination 分页组件'],
                                ['/components/radio', 'radio 单选框'],
                                ['/components/rate', 'rate 评分'],
                                ['/components/search', 'search 搜索框'],
                                ['/components/switch', 'switch 开关'],
                                ['/components/stepper', 'stepper 步进器'],
                                ['/components/upLoadimg', 'up-load-img 图片上传'],
                            ],
                        },
                    ],
                },
            ],
            '/guide': [
                {
                    title: '指南',
                    collapsable: false,
                    sidebarDepth: 0,
                    children: [
                        ['/guide/intro', '介绍'],
                        ['/guide/quickstart', '快速上手'],
                        ['/guide/commonStyle', '内置样式'],
                        ['/guide/techniques', '使用技巧'],

                        //	['/guide/addQQGroup', '加 QQ 群交流反馈'],
                        // ['/guide/customIcon', '扩展自定义图标库'],
                        // ['/guide/theme', '自定义主题'],
                        // ['/guide/i18n', '多语言切换'],
                        // ['/guide/globalVariable', '全局变量的实现'],
                        // ['/guide/codeHint', 'HBuilder X 代码提示'],
                        // ['/guide/design', '设计理念'],
                        // ['/guide/note', '注意事项'],
                    ],
                },
            ],

            '/tools': [
                {
                    title: '开发指南',
                    collapsable: false,
                    sidebarDepth: 0,
                    children: [
                        ['/js/intro', '介绍'],
                        ['/js/fastUse', '便捷工具'],
                    ],
                },
                {
                    title: '网络',
                    collapsable: false,
                    sidebarDepth: 0,
                    children: [['/js/http', 'Http 请求']],
                },
                {
                    title: '工具库',
                    collapsable: false,
                    sidebarDepth: 0,
                    children: [
                        ['/js/debounce', '节流防抖'],
                        ['/js/object', '对象操作'],
                        ['/js/time', '时间格式化'],
                        ['/js/route', '路由跳转'],
                        ['/js/randomArray', '数组乱序'],
                        ['/js/guid', '全局唯一标识符'],
                        ['/js/colorSwitch', '颜色转换'],
                        ['/js/color', '颜色值'],
                        ['/js/queryParams', '对象转 URL 参数'],
                        ['/js/test', '规则校验'],
                        ['/js/random', '随机数值'],
                        ['/js/trim', '去除空格'],
                        ['/js/getRect', '节点布局信息'],
                        ['/js/mpShare', '小程序分享'],
                    ],
                },
            ],
        },
        logo: '/common/logo.png',
        // 需要显示 H5 预览的地址集合
        simulatorUrl: [
            // '/components/intro',
            // '/components/install',
            // '/components/quickstart',
            // '/components/common',
            // '/components/changelog',
            // '/components/line',
            // '/components/color',
            // '/components/icon',
            // '/components/button',
            // '/components/text',
            // '/components/layout',
            // '/components/cell',
            // '/components/tabbar',
            // '/components/badge',
            // '/components/divider',
            // '/components/tag',
            // '/components/loadingIcon',
            // '/components/loadingPage',
            // '/components/slider',
            // '/components/album',
            // '/components/keyboard',
            // '/components/picker',
            // '/components/datetimePicker',
            // '/components/rate',
            // '/components/search',
            // '/components/numberBox',
            // '/components/upload',
            // '/components/code',
            // '/components/input',
            // '/components/tabsSwiper',
            // '/components/checkbox',
            // '/components/textarea',
            // '/components/radio',
            // '/components/switch',
            // '/components/modal',
            // '/components/list',
            // '/components/circleProgress',
            // '/components/lineProgress',
            // '/components/table',
            // '/components/countDown',
            // '/components/countTo',
            // '/components/tooltip',
            // '/components/actionSheet',
            // '/components/alert',
            // '/components/toast',
            // '/components/noticeBar',
            // '/components/notify',
            // '/components/collapse',
            // '/components/popup',
            // '/components/swipeAction',
            // '/components/overlay',
            // '/components/noNetwork',
            // '/components/grid',
            // '/components/swiper',
            // '/components/skeleton',
            // '/components/sticky',
            // '/components/tabs',
            // '/components/indexList',
            // '/components/subsection',
            // '/components/steps',
            // '/components/empty',
            // '/components/codeInput',
            // '/components/changeGuide',
            // '/components/avatarCropper',
            // '/components/loadMore',
            // '/components/readMore',
            // '/components/scrollList',
            // '/components/link',
            // '/components/transition',
            // '/components/lazyLoad',
            // '/components/gap',
            // '/components/avatar',
            // '/components/loading',
            // '/layout/menu',
            // '/components/image',
            // '/layout/coupon',
            // '/layout/SubmitBar',
            // '/layout/comment',
            // '/layout/order',
            // '/layout/intro',
            // '/layout/wxCenter',
            // '/layout/keyboardPay',
            // '/layout/login',
            // '/layout/address',
            // '/components/navbar',
            // '/components/calendar',
            // '/components/form',
            // '/components/backTop',
            // '/layout/citySelect',
            // '/guide/theme',
            // '/components/parse',
            // '/guide/i18n',
            // '/components/dropdown',
            // '/course/promise',
        ],
    },
}
